import vtk

# 创建一个球体源
sphereSource = vtk.vtkSphereSource()
sphereSource.SetCenter(0.0, 0.0, 0.0)
sphereSource.SetRadius(5.0)

# 映射器
mapper = vtk.vtkPolyDataMapper()
mapper.SetInputConnection(sphereSource.GetOutputPort())

# 演员
actor = vtk.vtkActor()
actor.SetMapper(mapper)

# 渲染器和渲染窗口
renderer = vtk.vtkRenderer()
renderWindow = vtk.vtkRenderWindow()
renderWindow.AddRenderer(renderer)

# 交互器
renderWindowInteractor = vtk.vtkRenderWindowInteractor()
renderWindowInteractor.SetRenderWindow(renderWindow)

# 将演员添加到渲染器
renderer.AddActor(actor)
renderer.SetBackground(0.1, 0.2, 0.3)

# 开始交互
renderWindow.Render()
renderWindowInteractor.Start()